/***********************************************************
 * Author: 	Brandon McKune
 * E-Mail:	bmckune.cs@gmail.com
 * Date:	September 2, 2011
 * Class:	Advanced OS
 * Time:	1150 - 1325
 * Smstr:	Fall 2011
 */

#ifndef CLTASK_H_
#define CLTASK_H_

#include "includes.h"
#include "ClRTClock.h"
#include "limits.h"

class ClTask{
public:
	ClTask();
	~ClTask();

	void randomize(uint64_t procSpeed);

	//Getters
	uint64_t getArrivalTime();
	uint64_t getDeadline();
	uint64_t getAbsoluteDeadline();
	uint64_t getComputationalTime();
	uint64_t getNumInstructions();
	uint64_t getNumInstructionsCompleted();
	uint64_t getFinishTime();
	uint64_t getAverageProcessedRateHz();
	double getSlackTime();

	//Setters
	void setMaxProcSpeedHz(uint64_t procSpeed);
	void setArrivalTime(uint64_t arrival);
	void setFinishedTime(uint64_t finishedTime);
	void setProcessedRateHz(uint64_t procRate);
	void incrementCompletedInstructions(uint64_t numInstructions);

	//Utility functions
	void printTaskInternals();
	bool metDeadline();
protected:
private:
	uint64_t m_uint64ArrivalTime;
	uint64_t m_uint64DeadlineTime;
	uint64_t m_uint64ComputationalTime;
	uint64_t m_uint64NumInstructions;
	uint64_t m_uint64NumInstructionsCompleted;
	uint64_t m_uint64FinishedTime;
	uint64_t m_uint64MaxProcSpeedHz;
	uint64_t m_uint64AverageProcessedRateHz;
};

#endif /* CLTASK_H_ */
